clear
addpath('vibp_base/')
addpath('util/')
addpath('heuristics/')


load( 'data.mat' );


param_set.alpha = alpha;                      
param_set.sigma_n = sigma_n;                 
param_set.sigma_a = sigma_a;                  


param_set.K                       = 6;        
param_set.restart_count           = 5;        
param_set.vibp_iter_count         = 2;        
param_set.use_tempering           = true;     
param_set.compute_intermediate_lb = false;    
param_set.stopping_thresh         = 0.1;      


param_set.show_final_plots        = false;   


param_set.test_mask = ones( size( X ) );
test_n_start1_ind = N - floor( N / 2 );
test_n_end1_ind = N - ceil( N / 3 );
test_n_start2_ind = N - floor( N / 3 );
test_n_end2_ind = N - ceil( N / 6 );
test_n_start3_ind = N - floor( N / 6 );
test_n_end3_ind = N;
param_set.test_mask( test_n_start1_ind:test_n_end1_ind , 1:3:end ) = 0;
param_set.test_mask( test_n_start2_ind:test_n_end2_ind , 2:3:end ) = 0;
param_set.test_mask( test_n_start3_ind:test_n_end3_ind , 3:3:end ) = 0;


param_set.do_finite_lg_variational    = true;
param_set.do_infinite_lg_variational  = true;


param_set.try_search_heuristics   = true;     
param_set.search_count            = 5;        
param_set.search_heuristic        = 'random'; 


param_set.add_data_in_blocks      = true;
param_set.data_block_size         = 10;       


param_set.sort_feature_order      = true;     


param_set.vary_update_order       = false;   


if param_set.do_finite_lg_variational
    fprintf('#################################################\n');
    fprintf('Running Finite LG Variational\n');
    fprintf('#################################################\n');
    path(path, './vibp_finite/');
    param_set.use_finite_model = true;
    param_set.model_type = 'LG';
    t = cputime;
    model_finite_LG_variational = run_vibp( X , param_set );
    model_finite_LG_variational.time_elapsed = cputime - t;
    rmpath('./vibp_finite')
end

if param_set.do_infinite_lg_variational
    fprintf('#################################################\n');
    fprintf('Running Infinite LG Variational\n');
    fprintf('#################################################\n');
    path(path, './vibp_infinite/');
    param_set.use_finite_model = false;
    param_set.model_type = 'LG';
    t = cputime;
    model_infinite_LG_variational = run_vibp( X , param_set );
    model_infinite_LG_variational.time_elapsed = cputime - t;
    rmpath('./vibp_infinite')
end

